package cn.wizzer.app.sys.modules.models;

import cn.wizzer.framework.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;

import java.io.Serializable;
import java.math.BigDecimal;

@EqualsAndHashCode(callSuper = true)
@Table("sys_param")
@Data
public class SysParam extends BaseModel implements Serializable {
    private static final long serialVersionUID = 1L;

    @Column
    @Name
    @Comment("ID")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    @PrevInsert(els = {@EL("uuid()")})
    private String id;

    @Column
    @Comment("注单自动确认")
    @Default("30")
    @ColDefine(type = ColType.INT, width = 4)
    private Integer confirmRunningOrderSecond;

    @Column
    @Comment("用户返水阈值")
    @Default("15")
    @ColDefine(type = ColType.INT, width = 4)
    private Integer selfRateMax;

    @Column
    @Comment("代理返水阈值")
    @Default("35")
    @ColDefine(type = ColType.INT, width = 4)
    private Integer superRateMax;

    @Column
    @Comment("返水总阈值")
    @Default("50")
    @ColDefine(type = ColType.INT, width = 4)
    private Integer totalRateMax;

    @Column
    @Comment("礼物分成默认值(百分之)")
    @Default("50")
    @ColDefine(type = ColType.INT, width = 4)
    private Integer giftRate;

    @Column
    @Comment("观点分成默认值(百分之)")
    @Default("80")
    @ColDefine(type = ColType.INT, width = 4)
    private Integer viewRate;

    @Column
    @Comment("游戏大厅")
    @Default("0")
    @ColDefine(type = ColType.BOOLEAN)
    private boolean gameSwitch;

    @Column
    @Comment("转账功能")
    @Default("0")
    @ColDefine(type = ColType.BOOLEAN)
    private boolean transferSwitch;

    @Column
    @Comment("跳过token验证")
    @Default("0")
    @ColDefine(type = ColType.BOOLEAN)
    private boolean debug;

    @Column
    @Comment("单次最低限制")
    @ColDefine(type = ColType.FLOAT, width = 16, precision = 6)
    @Default("10")
    private BigDecimal timeMinRestriction;

    @Column
    @Comment("单次最高限制")
    @ColDefine(type = ColType.FLOAT, width = 16, precision = 6)
    @Default("1000")
    private BigDecimal timeMaxRestriction;

    @Column
    @Comment("每日限制")
    @ColDefine(type = ColType.FLOAT, width = 16, precision = 6)
    @Default("10000")
    private BigDecimal dayRestriction;

    @Column
    @Comment("总限制")
    @ColDefine(type = ColType.FLOAT, width = 16, precision = 6)
    @Default("200000")
    private BigDecimal totalRestriction;

    @Column
    @Comment("用户自身返水比单位;万")
    @ColDefine(type = ColType.INT, width = 2)
    @Default("0")
    private Integer selfRate;

    @Column
    @Comment("用户所属代理返水比单位;万")
    @ColDefine(type = ColType.INT, width = 2)
    @Default("35")
    private Integer superRate;

    @Column
    @Comment("用户登录有效时长")
    @ColDefine(type = ColType.INT, width = 4)
    @Default("60")
    private Integer loginValidTime;

    @Column
    @Comment("有效赔率")
    @ColDefine(type = ColType.FLOAT, width = 16, precision = 6)
    @Default("0.6")
    private BigDecimal validOdds;

    @Column
    @Comment("观点发布限制")
    @ColDefine(type = ColType.INT, width = 4)
    @Default("5")
    private Integer viewReleaseLimit;

    @Column
    @Comment("观点标题最小长度")
    @ColDefine(type = ColType.INT, width = 4)
    @Default("8")
    private Integer viewTitleMinLength;

    @Column
    @Comment("观点标题最大长度")
    @ColDefine(type = ColType.INT, width = 4)
    @Default("15")
    private Integer viewTitleMaxLength;

    @Column
    @Comment("观点内容最小长度")
    @ColDefine(type = ColType.INT, width = 4)
    @Default("30")
    private Integer viewContentMinLength;

    @Column
    @Comment("用户默认头像")
    @ColDefine(type = ColType.VARCHAR, width = 128)
    private String defaultHeadPicture;

    @Column
    @Comment("客服聊天记录保留天数")
    @ColDefine(type = ColType.INT, width = 4)
    @Default("30")
    private Integer userChatMsgKeepDayNumber;

    @Column
    @Comment("群聊天记录保留天数")
    @ColDefine(type = ColType.INT, width = 4)
    @Default("30")
    private Integer groupLogKeepDayNumber;

    @Column
    @Comment("极光AppKey")
    @ColDefine(type = ColType.VARCHAR, width = 128)
    private String jgAppKey;

    @Column
    @Comment("极光密钥")
    @ColDefine(type = ColType.VARCHAR, width = 128)
    private String jgMasterSecret;

    @Column
    @Comment("直播推流地址")
    @Default("rtmp://47.114.170.23/live/")
    @ColDefine(type = ColType.VARCHAR, width = 128)
    private String pushVideoStreamUrl;

    @Column
    @Comment("直播播放地址")
    @Default("rtmp://47.114.170.23/live/")
    @ColDefine(type = ColType.VARCHAR, width = 128)
    private String pullVideoStreamUrl;

    @Column
    @Comment("点播播放地址")
    @Default("http://47.114.170.23/vdo/")
    @ColDefine(type = ColType.VARCHAR, width = 128)
    private String cmsVideoPlayUrl;

    @Column
    @Comment("赛程数据获取令牌")
    @Default("asdjpai123osjhd1241234pasjdp123as")
    @ColDefine(type = ColType.VARCHAR, width = 128)
    private String matchKey;


    //邮箱相关
    @Column
    @Comment("邮箱地址")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    @Default("smtp.ballgold365.com")
    private String emailHost;

    @Column
    @Comment("邮箱端口:win25/centOS465|587")
    @ColDefine(type = ColType.INT, width = 8)
    @Default("25")
    private Integer emailPort;

    @Column
    @Comment("邮箱用户")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    @Default("sys@ballgold365.com")
    private String emailUser;

    @Column
    @Comment("邮箱密码")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    @Default("777978@!JJ")
    private String emailPassword;

    @Column
    @Comment("邮件标题")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    @Default("BallGold")
    private String emailTitle;

    @Column
    @Comment("邮件内容，验证码需带上[%s]，例 --> 验证码：[%s]")
    @ColDefine(type = ColType.VARCHAR, width = 128)
    @Default("Verify Code:[%s]")
    private String emailContent;

    @Column
    @Comment("邮件接收人")
    @ColDefine(type = ColType.VARCHAR, width = 128)
    private String emailReceiver;

    // 主播分润 %
    // 足篮专家分成 %
    // 可转出充值消费比


    public boolean getGameSwitch() {
        return gameSwitch;
    }

    public boolean getTransferSwitch() {
        return transferSwitch;
    }

}
